package com.forekonw.demo5;

/**
 *
 * 构造器  就是一个特殊的方法，
 */
public class ConstrctorDemo1 {
    private String name;
    private int age;
    private String[] string;
    private Emplyee emp;

    public ConstrctorDemo1(String name,int age){
        this.name = name;
        this.age = age;
//        this.string= string;
        string = new String[10];
        emp = new Emplyee();
    }

    public String[] getString() {
        return string;
    }

    public void setString(String[] string) {
        this.string = string;
    }

    public Emplyee getEmp() {
        return emp;
    }

    public void setEmp(Emplyee emp) {
        this.emp = emp;
    }

    //通过构造器来初始化属性


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }



    public static void main(String[] args) {
        ConstrctorDemo1 c = new ConstrctorDemo1("fender",12);
        String [] a ={"1","2","3"};
        c.setString(a);
        String[] d =c.getString();
        for(int i = 0 ;i <d.length;i++){
            System.out.println(d[i]);
        }
        System.out.println(c.getName()+c.getAge());
    }
}
